<?php

namespace App\Models;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    protected $fillable = ['title','content','class','users_id','thumbnail','updated_at','partid','location'];

    public function user(){
        return $this->belongsTo('App\User','users_id');
    }


    public static function hasUser($aid)
    {

        $art = new self();
        if( $art->find($aid)->users_id==Auth::user()->id  ){
            return true;
        }
        return false;
    }






}
